import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 导入svg适量图标
import 'virtual:svg-icons-register'
import App from '@/App.vue'
//@ts-ignore忽略当前文件ts类型的检测否则有红色提示(打包会失败)
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
// 引入全局样式文件
import '@/styles/index.scss'
// 在入口文件引入src/index.ts文件,通过app.use方法安装自定义插件
import gloablComponent from './components/index'
import router from '@/router/index'
import pinia from '@/store/index.ts'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
// 权健文件
// import '@/router/permission.ts'

const app = createApp(App)
app.use(ElementPlus, {
  locale: zhCn,
})
app.use(gloablComponent)
app.use(router)
app.use(pinia)
pinia.use(piniaPluginPersistedstate)
// 注册持久化插件
// 测试mock接口
// import axios from 'axios'
// axios({
//   url: '/api/user/login',
//   method: "post",
//   data: {
//     username: 'admin',
//     password: '123456'
//   }
// })

// console.log(import.meta.env) 当前为开发环境
app.mount('#app')
